<template>
    <div class="app-container">
        <el-card shadow="never">
            <!-- 条件查询 -->
            <el-form v-show="showSearch" ref="queryForm" :model="queryParams" label-width="120px" @keyup.enter.native="submitSearch" @submit.native.prevent>
                <el-row>
                    <!-- <el-col :md="6" :sm="12">
                        <el-form-item label="id:" prop="id.value">
                            <el-input v-model="queryParams.id.value" placeholder="请输入id" clearable />
                        </el-form-item>
                    </el-col> -->
                    <!-- <el-col :md="6" :sm="12">
                        <el-form-item label="平台:" prop="title.value">
                            <el-input v-model="queryParams.title.value" placeholder="请输入平台" clearable />
                        </el-form-item>
                    </el-col> -->

                    <!-- <el-col :md="6" :sm="12">
                        <el-form-item class="ele-text-right" label-width="50px">
                            <el-button type="primary" size="mini" @click="submitSearch" icon="el-icon-search" class="ele-btn-icon">搜索 </el-button>
                            <el-button @click="resetQuery" size="mini" icon="el-icon-refresh">重置</el-button>

                        </el-form-item>
                    </el-col> -->
                </el-row>
            </el-form>

            <el-row :gutter="10" class="mb8">
                <el-col :span="1.5">
                    <el-button type="primary" plain icon="el-icon-plus" size="mini" @click="open" v-hasPermi="api.add">添加</el-button>
                </el-col>
                <!-- <el-col :span="1.5">
                    <el-button type="danger" plain icon="el-icon-delete" size="mini" :disabled="multiple" @click="handleDelete" v-hasPermi="api.delete">删除</el-button>
                </el-col> -->
                <!-- <el-col :span="1.5">
                    <el-button type="warning" plain icon="el-icon-download" size="mini" v-loading="exportLoading" @click="handleExport" v-hasPermi="api.export">导出</el-button>
                </el-col> -->
                <!-- <right-toolbar :showSearch.sync="showSearch" @queryTable="initIndex" :columns="columns" printId="#quickadmin"></right-toolbar> -->
            </el-row>
            <!-- 列表 -->
            <el-table 
                :data="tableData" 
                border
                style="width: 100%">
                    <el-table-column label="开户主体" width="" align="center">
                        <template slot-scope="scope">
                            <span>{{ scope.row.advplat_id }}</span>  
                        </template>    
                    </el-table-column>
                    <el-table-column label="平台" width="" align="center">
                        <template slot-scope="scope">
                            <span>{{ scope.row.adv_name }}</span>
                        </template>    
                    </el-table-column>
                    <el-table-column label="账户组" width="" align="center">
                        <template slot-scope="scope">
                            <span>{{ scope.row.account }}</span>
                        </template>
                    </el-table-column>
                    <el-table-column label="归属人" width="" align="center">
                        <template slot-scope="scope">
                            <span>{{ scope.row.site_name }}</span>
                        </template>    
                    </el-table-column>
                    <el-table-column label="开始时间" width="" align="center">
                        <template slot-scope="scope">
                            <span>{{ scope.row.change_time }}</span>
                        </template>    
                    </el-table-column>
                    <el-table-column label="结束时间" width="" align="center">
                        <template slot-scope="scope">
                            <span>{{ scope.row.change_time }}</span>
                        </template>    
                    </el-table-column>
                    <el-table-column label="变更备注" width="" align="center">
                        <template slot-scope="scope">
                            <span>{{ scope.row.change_remarks }}</span>
                        </template>    
                    </el-table-column>
                    <el-table-column label="操作" align="center">
                        <template slot-scope="scope">
                            <el-button class="btn-mar" size="mini" type="primary" @click="handleEdit(scope.row)" v-hasPermi="api.edit">修改</el-button>
                            <!-- <el-button class="btn-mar" size="mini" type="info" @click="handleDetail(scope.row)" v-hasPermi="api.find">详情</el-button> -->
                            <!-- <el-button class="btn-mar" size="mini" type="danger" @click="handleDelete(scope.row)" v-hasPermi="api.delete">删除</el-button> -->
                        </template>
                    </el-table-column>

            </el-table>

            <!-- 分页 -->
            <pagination :total="total" :page.sync="pageInfo.page" :limit.sync="pageInfo.limit" @pagination="initIndex" />
        </el-card>

        <!-- 编辑弹窗 -->
        <el-dialog :title="!disabled ? '编辑' : '详情'" :visible="editOpen"  :before-close="beforeClose" destroy-on-close>
            <EditForm ref="editForm" :findFormData="findFormData"  :disabled="disabled" @submitForm="submitForm" :editFormParams="editFormParams" @editFormCancel="beforeClose" />
        </el-dialog>

    </div>
</template>

<script>
import { curdMixin } from '@/mixins/curdMixin'
import EditForm from '../advplat/EditFormCom'
export default {
    name: 'Curd',
    mixins: [curdMixin],
    components: { EditForm },
    
    data() {
        return {
            // table结构
            columns: [
                

            ],
            tableData: [
                

            ],
            // 接口地址
            api: {
                index: `/admin/attributor/index`,
                find: `/admin/attributor/find`,
                add: `/admin/attributor/add`,
                edit: `/admin/attributor/edit`,
                delete: `/admin/attributor/delete`,
                export: `/admin/attributor/export`,
                status: `/admin/attributor/status`
            },
            editFormParams: {
            },
            pageInfo: {
                sort: 'id',
            },
            primaryKey: 'id',
            // 搜索表单是否展开
            searchExpand: false,
              //是否展示搜索
            showSearch: true,
            // 查询参数
            queryParams: {
                id: { value:undefined, op: '='},
                title: { value:undefined, op: '%like%'},
                site_id: { value:undefined, op: '='},

            },

        }
    },
    created () {
        this.initIndex()
    },
    watch: {
        
    },
    methods: {
        // blurs() {
        //     console.log('test',this.tableData);
            
        // },
        // 案列：当前组件格式化方法
        testFormatter(prop) {
            return prop
        },
        
    }
}
</script>
<style lang="scss" scoped>
.btn-mar {
    margin: 5px !important;
}
.el-table {
    // 默认情况下，即没有选中某一行时，只显示span
    span {
        display: block;
    }
    .el-input {
        display: none;
    }
    .el-select {
        display: none;
    }
  // 当点击某一行时，对应的行会添加current-row类，则内部的新的样式会生效
    .current-row {
        span {
        display: none;
        }
        .el-input {
            display: block;
        }
        .el-select {
            display: block;
        }
    }
}
</style>